import request from '@/utils/request';
import { rsaEncrypt } from '@/utils/commonUtil3';

// 获取协议列表
export function getAgreementList(data) {
	return request({
		url: '/agreement/select',
		method: 'get',
		params: data
	});
}

// 添加协议
export function addAgreement(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/agreement/insert',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 修改协议
export function updateAgreement(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/agreement/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

//删除协议
export function deleteAgreement(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/agreement/delete',
		method: 'delete',
		data: {
			data: data1
		}
	});
}

// 获取用户列表
export function getUserList(data) {
	return request({
		url: '/ecUser/select',
		method: 'get',
		params: data
	});
}

// 修改用户状态
export function updateUserStatus(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecUser/updateEcUser',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 分页查询电商门店档案
export function getShopList(data) {
	return request({
		url: '/ecStore/select',
		method: 'get',
		params: data
	});
}

// 审核电商门店
export function updateShopStatus(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecStore/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 获取门店所有列表
export function getShopAllList(data) {
	return request({
		url: '/ecStore/selectList',
		method: 'get',
		params: data
	});
}

// 获取分类列表
export function getShopCategoryList(data) {
	return request({
		url: '/ecCategory/select',
		method: 'get',
		params: data
	});
}

// 修改分类
export function updateShopCategory(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecCategory/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 获取非标分类列表
export function getShopgenericCategoryList(data) {
	return request({
		url: '/ecNonCategory/select',
		method: 'get',
		params: data
	});
}

// 修改非标分类
export function updateShopgenericCategory(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecNonCategory/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 查询商家小程序后台系统配置
export function getShopConfig(data) {
	return request({
		url: '/ecSetting/select',
		method: 'get',
		params: data
	});
}

//修改商家小程序订单起送价格
export function updateShopConfig(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecSetting/updateMinPrice',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 修改商家小程序客服经理电话
export function updateShopConfigPhone(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecSetting/updateService',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 分页查找erp商品档案
export function getErpGoodsList(data) {
	return request({
		url: '/ecCommodity/selectErpCommodity',
		method: 'get',
		params: data
	});
}

// 商家小程序后台商品新增选定商品
export function getErpCommodityDetail(data) {
	return request({
		url: '/ecCommodity/getErpCommodity',
		method: 'get',
		params: data
	});
}

// 商家小程序后台商品新增选定商品
export function addErpCommodity(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecCommodity/insert',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 分页查询商家小程序后台电商商品档案
export function getShopCommodityList(data) {
	return request({
		url: '/ecCommodity/select',
		method: 'get',
		params: data
	});
}

// 查询商家小程序后台电商商品档案详情
export function getShopCommodityDetail(data) {
	return request({
		url: '/ecCommodity/selectDetail',
		method: 'get',
		params: data
	});
}

// 修改商家小程序后台电商商品档案
export function updateShopCommodity(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecCommodity/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 删除商家小程序后台电商商品档案
export function deleteShopCommodity(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecCommodity/delete',
		method: 'delete',
		data: {
			data: data1
		}
	});
}

// 电商非标商品档案分页条件查询
export function getShopNonCommodityList(data) {
	return request({
		url: '/ecNonCommodity/select',
		method: 'get',
		params: data
	});
}

// 删除电商非标商品档案
export function deleteShopNonCommodity(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecNonCommodity/delete',
		method: 'delete',
		data: {
			data: data1
		}
	});
}

// 查询erp电商非标商品档案
export function getErpNonCommodityList(data) {
	return request({
		url: '/ecNonCommodity/selectInfo',
		method: 'get',
		params: data
	});
}

// 创建电商非标商品档案
export function addShopNonCommodity(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecNonCommodity/insert',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 修改电商非标商品档案
export function updateShopNonCommodity(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecNonCommodity/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 查询电商非标商品档案详情
export function getShopNonCommodityDetail(data) {
	return request({
		url: '/ecNonCommodity/details',
		method: 'get',
		params: data
	});
}

// 查询电商订单列表
export function getShopOrderList(data) {
	return request({
		url: '/ecOrder/select',
		method: 'get',
		params: data
	});
}

// 小程序后台获取电商订单详情
export function getShopOrderDetail(data) {
	return request({
		url: '/ecOrder/selectDetails',
		method: 'get',
		params: data
	});
}

// 获取物流信息
export function getLogisticsInfo(data) {
	return request({
		url: '/ecOrder/getDeliverList',
		method: 'get',
		params: data
	});
}

// 确认订单信息
export function confirmOrderInfo(data) {
	return request({
		url: '/ecOrder/getType',
		method: 'get',
		params: data
	});
}

// 订单发货
export function orderDelivery(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecOrder/uploadShippingInfo',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 获取退款订单详情
export function getRefundOrderDetail(data) {
	return request({
		url: '/ecRefunds/details',
		method: 'get',
		params: data
	});
}

// 电商订单退货
export function shopOrderReturn(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/ecRefunds/create',
		method: 'post',
		data: {
			data: data1
		}
	});
}
